package nongchang.kuaijiecaifu.com.ncapp_android.util;

import ezy.lite.util.DateTime;

/**
 * Created by ezy on 15/11/10.
 *
 */
public class Convert {
    // hh:mm
    public static String toRevealedTime(long time) {
        long now = System.currentTimeMillis();
        long diff =  time - (now - now % DateTime.DAY);
        if (diff < DateTime.DAY) {
            return "今天 " + DateTime.toShortTime(time);
        } else if (diff < 2 * DateTime.DAY) {
            return "昨天 " + DateTime.toShortTime(time);
        } else {
            return (int)(diff / DateTime.DAY) + "天 " + DateTime.toShortTime(time);
        }
    }
}
